package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.YxDeviceUseableTimeMapper;
import com.ruoyi.system.domain.YxDeviceUseableTime;
import com.ruoyi.system.service.IYxDeviceUseableTimeService;

/**
 * 设备可用日期Service业务层处理
 * 
 * @author lingyu
 * @date 2024-03-11
 */
@Service
public class YxDeviceUseableTimeServiceImpl implements IYxDeviceUseableTimeService 
{
    @Autowired
    private YxDeviceUseableTimeMapper yxDeviceUseableTimeMapper;

    /**
     * 查询设备可用日期
     * 
     * @param id 设备可用日期主键
     * @return 设备可用日期
     */
    @Override
    public YxDeviceUseableTime selectYxDeviceUseableTimeById(Long id)
    {
        return yxDeviceUseableTimeMapper.selectYxDeviceUseableTimeById(id);
    }

    /**
     * 查询设备可用日期列表
     * 
     * @param yxDeviceUseableTime 设备可用日期
     * @return 设备可用日期
     */
    @Override
    public List<YxDeviceUseableTime> selectYxDeviceUseableTimeList(YxDeviceUseableTime yxDeviceUseableTime)
    {
        return yxDeviceUseableTimeMapper.selectYxDeviceUseableTimeList(yxDeviceUseableTime);
    }

    /**
     * 新增设备可用日期
     * 
     * @param yxDeviceUseableTime 设备可用日期
     * @return 结果
     */
    @Override
    public int insertYxDeviceUseableTime(YxDeviceUseableTime yxDeviceUseableTime)
    {
        yxDeviceUseableTime.setCreateTime(DateUtils.getNowDate());
        return yxDeviceUseableTimeMapper.insertYxDeviceUseableTime(yxDeviceUseableTime);
    }

    /**
     * 修改设备可用日期
     * 
     * @param yxDeviceUseableTime 设备可用日期
     * @return 结果
     */
    @Override
    public int updateYxDeviceUseableTime(YxDeviceUseableTime yxDeviceUseableTime)
    {
        return yxDeviceUseableTimeMapper.updateYxDeviceUseableTime(yxDeviceUseableTime);
    }

    /**
     * 批量删除设备可用日期
     * 
     * @param ids 需要删除的设备可用日期主键
     * @return 结果
     */
    @Override
    public int deleteYxDeviceUseableTimeByIds(Long[] ids)
    {
        return yxDeviceUseableTimeMapper.deleteYxDeviceUseableTimeByIds(ids);
    }

    /**
     * 删除设备可用日期信息
     * 
     * @param id 设备可用日期主键
     * @return 结果
     */
    @Override
    public int deleteYxDeviceUseableTimeById(Long id)
    {
        return yxDeviceUseableTimeMapper.deleteYxDeviceUseableTimeById(id);
    }
}
